package com.hotel.common.result;

import java.util.List;

import com.hotel.common.enums.BaseResultCodeEnum;

/**
 * 多值类列表返回结果，带分页
 * <pre>
 * 注意：
 * 该结果主要供大数据类的分页查询使用
 * </pre>
 * 
 * @author peitong.xue
 * @version 1.0
 * @since 1.0 2015年11月21日 下午11:44:54
 */
public class MultiPageResult<T> extends CommonResult {

    /** serialVersionUID */
    private static final long serialVersionUID = 3297930073741379677L;

    /** 结果列表 */
    private List<T>           dataList;

    /** 是否下一页 */
    private boolean           hasNextPage;

    /**
     * 默认构造函数
     * 
     */
    public MultiPageResult() {
    }

    /**
     * 构造函数
     * 
     * @param resultCodeEnum 结果编码
     */
    public MultiPageResult(BaseResultCodeEnum baseResultCodeEnum, List<T> dataList,
                           boolean hasNextPage) {
        setSuccess(baseResultCodeEnum == BaseResultCodeEnum.ERR_CODE_200);
        setResultCode(baseResultCodeEnum.getCode());
        setResultMsg(baseResultCodeEnum.getMsg());
        setDataList(dataList);
        setHasNextPage(hasNextPage);
    }

    /**
     * Getter method for property <tt>dataList</tt>.
     * 
     * @return property value of dataList
     */
    public List<T> getDataList() {
        return dataList;
    }

    /**
     * Setter method for property <tt>dataList</tt>.
     * 
     * @param dataList value to be assigned to property dataList
     */
    public void setDataList(List<T> dataList) {
        this.dataList = dataList;
    }

    /**
     * Getter method for property <tt>hasNextPage</tt>.
     * 
     * @return property value of hasNextPage
     */
    public boolean isHasNextPage() {
        return hasNextPage;
    }

    /**
     * Setter method for property <tt>hasNextPage</tt>.
     * 
     * @param hasNextPage value to be assigned to property hasNextPage
     */
    public void setHasNextPage(boolean hasNextPage) {
        this.hasNextPage = hasNextPage;
    }

}
